
malloc-struct.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <main>:
	char name[10];
	int age;
}son;

void main()
{
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
   8:	e24dd018 	sub	sp, sp, #24
	struct stu student1;
	struct stu * p;
	son * pson;

	strcpy(student1.name, "xiaozhi");
   c:	e24b301c 	sub	r3, fp, #28
  10:	e59f210c 	ldr	r2, [pc, #268]	; 124 <main+0x124>
  14:	e8920003 	ldm	r2, {r0, r1}
  18:	e8830003 	stm	r3, {r0, r1}
	student1.age = 35;
  1c:	e3a03023 	mov	r3, #35	; 0x23
  20:	e50b3010 	str	r3, [fp, #-16]
	printf("student1 name is : %s\n",student1.name);
  24:	e24b301c 	sub	r3, fp, #28
  28:	e1a01003 	mov	r1, r3
  2c:	e59f00f4 	ldr	r0, [pc, #244]	; 128 <main+0x128>
  30:	ebfffffe 	bl	0 <printf>
	printf("student1 age is : %d\n",student1.age);
  34:	e51b3010 	ldr	r3, [fp, #-16]
  38:	e1a01003 	mov	r1, r3
  3c:	e59f00e8 	ldr	r0, [pc, #232]	; 12c <main+0x12c>
  40:	ebfffffe 	bl	0 <printf>

	p = (struct stu *) malloc (sizeof(struct stu));
  44:	e3a00010 	mov	r0, #16
  48:	ebfffffe 	bl	0 <malloc>
  4c:	e1a03000 	mov	r3, r0
  50:	e50b3008 	str	r3, [fp, #-8]
	strcpy(p->name, "zixi");
  54:	e51b3008 	ldr	r3, [fp, #-8]
  58:	e59f20d0 	ldr	r2, [pc, #208]	; 130 <main+0x130>
  5c:	e1a00003 	mov	r0, r3
  60:	e1a01002 	mov	r1, r2
  64:	e3a03005 	mov	r3, #5
  68:	e1a02003 	mov	r2, r3
  6c:	ebfffffe 	bl	0 <memcpy>
	p->age = 2;
  70:	e51b3008 	ldr	r3, [fp, #-8]
  74:	e3a02002 	mov	r2, #2
  78:	e583200c 	str	r2, [r3, #12]
	printf("student2 name is : %s\n",p->name);
  7c:	e51b3008 	ldr	r3, [fp, #-8]
  80:	e1a01003 	mov	r1, r3
  84:	e59f00a8 	ldr	r0, [pc, #168]	; 134 <main+0x134>
  88:	ebfffffe 	bl	0 <printf>
	printf("student2 age is : %d\n",p->age);
  8c:	e51b3008 	ldr	r3, [fp, #-8]
  90:	e593300c 	ldr	r3, [r3, #12]
  94:	e1a01003 	mov	r1, r3
  98:	e59f0098 	ldr	r0, [pc, #152]	; 138 <main+0x138>
  9c:	ebfffffe 	bl	0 <printf>

	pson = (son *) malloc (sizeof (son));
  a0:	e3a00010 	mov	r0, #16
  a4:	ebfffffe 	bl	0 <malloc>
  a8:	e1a03000 	mov	r3, r0
  ac:	e50b300c 	str	r3, [fp, #-12]
	strcpy(pson->name, "zhen");
  b0:	e51b300c 	ldr	r3, [fp, #-12]
  b4:	e59f2080 	ldr	r2, [pc, #128]	; 13c <main+0x13c>
  b8:	e1a00003 	mov	r0, r3
  bc:	e1a01002 	mov	r1, r2
  c0:	e3a03005 	mov	r3, #5
  c4:	e1a02003 	mov	r2, r3
  c8:	ebfffffe 	bl	0 <memcpy>
	pson->age = 3;
  cc:	e51b300c 	ldr	r3, [fp, #-12]
  d0:	e3a02003 	mov	r2, #3
  d4:	e583200c 	str	r2, [r3, #12]

	printf("son name is : %s\n",pson->name);
  d8:	e51b300c 	ldr	r3, [fp, #-12]
  dc:	e1a01003 	mov	r1, r3
  e0:	e59f0058 	ldr	r0, [pc, #88]	; 140 <main+0x140>
  e4:	ebfffffe 	bl	0 <printf>
	printf("son age is : %d\n",pson->age);
  e8:	e51b300c 	ldr	r3, [fp, #-12]
  ec:	e593300c 	ldr	r3, [r3, #12]
  f0:	e1a01003 	mov	r1, r3
  f4:	e59f0048 	ldr	r0, [pc, #72]	; 144 <main+0x144>
  f8:	ebfffffe 	bl	0 <printf>

	free(p);
  fc:	e51b0008 	ldr	r0, [fp, #-8]
 100:	ebfffffe 	bl	0 <free>
	free(pson);
 104:	e51b000c 	ldr	r0, [fp, #-12]
 108:	ebfffffe 	bl	0 <free>
	p = NULL;
 10c:	e3a03000 	mov	r3, #0
 110:	e50b3008 	str	r3, [fp, #-8]
	pson = NULL;
 114:	e3a03000 	mov	r3, #0
 118:	e50b300c 	str	r3, [fp, #-12]

}
 11c:	e24bd004 	sub	sp, fp, #4
 120:	e8bd8800 	pop	{fp, pc}
 124:	00000000 	.word	0x00000000
 128:	00000008 	.word	0x00000008
 12c:	00000020 	.word	0x00000020
 130:	00000038 	.word	0x00000038
 134:	00000040 	.word	0x00000040
 138:	00000058 	.word	0x00000058
 13c:	00000070 	.word	0x00000070
 140:	00000078 	.word	0x00000078
 144:	0000008c 	.word	0x0000008c
